IF OBJECT_ID('up_Vendor_Visit_XMissionStructures_Images_SelectById') IS not NULL
DROP PROC up_Vendor_Visit_XMissionStructures_Images_SelectById

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'up_Vendor_Visit_XMissionStructures_Images_SelectById')
	DROP PROCEDURE up_Vendor_Visit_XMissionStructures_Images_SelectById
GO

CREATE PROCEDURE [dbo].[up_Vendor_Visit_XMissionStructures_Images_SelectById] 
(
	@imageID int
)
AS

SELECT 
	Vendor_Visit_XMissionStructures_ImageId as 'ID',
	Vendor_Visit_XMissionStructureFK as 'PoleId',
	Filename as 'FileName'
FROM 
	tb_Vendor_Visit_XMissionStructures_Images	 
WHERE
	Vendor_Visit_XmissionStructures_ImageId = @imageID
